package com.atguigu.gmall.all.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * 用户认证接口
 */
@Controller
public class PassportController {
    // 登录按钮请求地址：'http://passport.gmall.com/login.html?originUrl='+window.location.href
    @GetMapping("login.html")
    public String login(HttpServletRequest request){
        // originUrl 表示用户点击登录跳转前所在的url
        // 从请求中获取参数 originUrl
        String originUrl = request.getParameter("originUrl");

        request.setAttribute("originUrl",originUrl);

        return "login";
    }
}
